function Geometry(){
	this.vertices = new Array();
	this.vertexSize = 3;
	this.createVertices = function(){
	}
	this.getVertices = function(){
		return null;
	}
}

SphereGeometry.prototype = new Geometry();  
SphereGeometry.prototype.constructor=SphereGeometry;
function SphereGeometry(center, r){
	this.vertices = null;
	this.vertexSize = 3;
	this.precistion = 8;
	
	this.colors = null;
	this.colorSize = 3;
	
	this.indices = null;
	
	this.createVertices = function(){
		var latitudeBands = this.precistion;
		var longitudeBands = this.precistion;
		var vertexPositionData = [];
		var colors = [];
		var indexData = [];
		for (var latNumber=0; latNumber < latitudeBands; latNumber++) {
			var theta = latNumber * Math.PI / latitudeBands;
			var sinTheta = Math.sin(theta);
			var cosTheta = Math.cos(theta);

			for (var longNumber=0; longNumber < longitudeBands; longNumber++) {
				var phi = longNumber * 2 * Math.PI / longitudeBands;
				var sinPhi = Math.sin(phi);
				var cosPhi = Math.cos(phi);

				var x = cosPhi * sinTheta;
				var y = cosTheta;
				var z = sinPhi * sinTheta;

				colors = [[1.0, 1.0, 0.3, 1.0]];
				vertexPositionData.push(radius * x);
				vertexPositionData.push(radius * y);
				vertexPositionData.push(radius * z);

				var first = (latNumber * (longitudeBands + 1)) + longNumber;
				var second = first + longitudeBands + 1;
				indexData.push(first);
				indexData.push(second);
				indexData.push(first + 1);

				indexData.push(second);
				indexData.push(second + 1);
				indexData.push(first + 1);
			}
		}

		var unpackedColors = [];
		for (var i in colors) {
			var color = colors[i];
			for (var j=0; j < 4; j++) {
				unpackedColors = unpackedColors.concat(color);
			}
		}
		
		this.vertices = vertexPositionData;
		this.colors = unpackedColors;
		this.indeces = indexData;
	}
	this.getVertices = function(){
		if(this.vertices==null) this.createVertices();
		return this.vertices;	
	}	
}